﻿using System;
using System.IO;

namespace Sylva.AppML.DatabaseSchema
{
    public partial class SchemaManager
    {
        public class GenerateEdmOptions
        {
            const string ProviderInvariantNameDefault = "System.Data.SqlClient";
            const string StoreSchemaFileExtention = ".ssdl";

            public GenerateEdmOptions()
            {
                this.ProviderInvariantName = ProviderInvariantNameDefault;
                this.EntityContainer = "ProductEntities";
                this.Namespace = "ProductModel";
                this.Project = "ProductProject";
            }

            public GenerateEdmOptions(string connectionString,
                string generatedPath)
                : this()
            {
                this.ConnectionString = connectionString;
                this.GeneratedPath = generatedPath;
            }
            
            public String ConnectionString { get; set; }
            public String EntityContainer { get; set; }
            public String GeneratedPath { get; set; }
            public String Namespace { get; set; }
            public String Project { get; set; }
            public String ProviderInvariantName { get; set; }

            /// <summary>
            /// Gets the store schema file name.
            /// </summary>
            public string StoreSchemaFileName
            {
                get
                {
                    return Path.Combine(this.GeneratedPath, this.Project + StoreSchemaFileExtention);
                }
            }
        }
    }
}
